package factory_pattern;

/**
 * @author wangzg13
 * @since 2022/9/14
 */
public class Client {
    public static void main(String[] args) {
        // 创建工厂，然后创建各人类
        HumanFactory humanFactory = new HumanFactory();
        Human bHuman = humanFactory.createHuman(BlackHuman.class);
        bHuman.getColor();
        bHuman.talk();
        Human wHuman = humanFactory.createHuman(WhiteHuman.class);
        wHuman.getColor();
        wHuman.talk();
        Human yHuman = humanFactory.createHuman(YellowHuman.class);
        yHuman.getColor();
        yHuman.talk();
    }
}
